package com.paziy.notes.core.notations;

import com.paziy.notes.core.notes.Accidental;

/**
 * Represents the all key signatures
 *
 * @author thecederick@gmail.com (Paziy Evgeniy)
 * @version 0.1
 * @since 0.1 (09.12.13 11:39)
 */
public enum KeySignature {

    Blank(null, (byte) 0),
    OneFlat(Accidental.FLAT, (byte) 1),
    TwoFlats(Accidental.FLAT, (byte) 2),
    ThreeFlats(Accidental.FLAT, (byte) 3),
    FourFlats(Accidental.FLAT, (byte) 4),
    FiveFlats(Accidental.FLAT, (byte) 5),
    SixFlats(Accidental.FLAT, (byte) 6),
    SevenFlats(Accidental.FLAT, (byte) 7),
    OneSharp(Accidental.SHARP, (byte) 1),
    TwoSharps(Accidental.SHARP, (byte) 2),
    ThreeSharps(Accidental.SHARP, (byte) 3),
    FourSharps(Accidental.SHARP, (byte) 4),
    FiveSharps(Accidental.SHARP, (byte) 5),
    SixSharps(Accidental.SHARP, (byte) 6),
    SevenSharps(Accidental.SHARP, (byte) 7);

    /**
     * The default key signature. Most used.
     */
    public static final KeySignature DEFAULT_KEY_SIGNATURE = Blank;

    /**
     * The Symbol (accidental) of key signature
     */
    private Accidental accidentalSymbol;

    /**
     * Count of symbols
     */
    private byte count;

    KeySignature(Accidental accidentalSymbol, byte count) {
        this.accidentalSymbol = accidentalSymbol;

        this.count = count;
    }

    /**
     * Returns the accidental symbol.
     * @see KeySignature#accidentalSymbol
     *
     * @return accidental symbol
     */
    private Accidental getAccidental() {
        return accidentalSymbol;
    }

    /**
     * Returns the count of the accident symbol.
     *
     * @return the count of the accident symbol
     */
    public byte getCount() {
        return count;
    }
}
